package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.business.domain.query.ProductionInvQuery;
import com.qijian.maindata.domain.ProductionInv;
import com.qijian.maindata.domain.vo.ProductionInvVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 产成品库存Mapper接口
 *
 * @author qijian
 * @date 2024-06-30
 */
public interface ProductionInvMapper extends BaseMapper<ProductionInv> {

    @Select("select count(0) from im_production_inv WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    Page<ProductionInvVo> pageVo(Page<ProductionInvVo> page, @Param(Constants.WRAPPER) QueryWrapper<ProductionInvQuery> queryWrapper
            , @Param("queryType") String queryType);

    int batchStoreIn(@Param("projects") List<Long> projects, @Param("userId") Long userId, @Param("factoryId") Long factoryId);
}
